home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
BTH2SRC.ZIP
/
BTH2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-12-09
|
21KB
|
646 lines
(*
__ $$m. ____ .mm. ______________ .m$$ _______________________________
~~ $$$$ ~~~~ $$$$ ~~~~~~~~~~~~~~ $$$$ .m$$$$$m.
$$$$$$$m. $$$$ .m$$$$$m. .m$$$$$$$ $$$$ $$$$
$$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$$$$$$ Beyond The Horizon
$$$$ $$$$ $$$$ $$$$$$$$$ $$$$ $$$$ $$$$ issue #2
$$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$m. .
$$$$$$$$~ $$$$ $$$$ $$$$ $$$$$$$$$ $$$$$$$$$ : .
________________________________________________________|____:_______
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coded by : shivan bastard (murray@jax.gulfnet.com) *)
{ source code release notes : the only change i have made is take out the
FLI (vga animation) because it it too elite for you lamerz to rip! }
program Beyond_the_Horizon_Issue_2;
uses crt,dos,unc,winttt5;
type
ScreenType = array [0..3999] of Byte;
var
ScreenAddr : ScreenType absolute $B800:$0000;
percent,percent2:real;
min,n,limit,max,count,i,q,x,y:integer;
marker,ch:char;
found,done:boolean;
output,ansi,screen,af,tf:text;
s,fn,title,author:string;
ray:array[1..500] of string[64];
yy:byte;
{$I intro.pas}
{$I main.pas}
{$I reader.pas}
{$I end.pas}
{$L sites.obj}
procedure bbs;external;
{$L members.obj}
procedure mem;external;
{$L nfo.obj}
procedure edge;external;
procedure tc (i: integer); begin textcolor (i);end;
procedure tb (i: integer); begin textbackground (i);end;
procedure nl; begin writeln;end;
procedure waitretrace;assembler; {wait for next vertical retrace}
asm
mov dx,$3DA
@V1: in al,dx; test al,8; jz @v1;
@V2: in al,dx; test al,8; jnz @v2;
end;
type
rgb = record r, g, b : byte; end;
paltype = array[0..255]of rgb;
var
j : integer;
pal : paltype;
procedure get_color(var pal : paltype); {save palette}
var
j : integer;
begin
port[$3C7] := $00;
for j:= 0 to 255 do begin
pal[j].r := port[$3C9];
pal[j].g := port[$3C9];
pal[j].b := port[$3C9];
end;
end;
procedure set_intensity(intensity : byte);
var
j : integer;
begin
port[$3C8] := $00;
for j := 0 to 255 do begin
port[$3C9] := pal[j].r*intensity div 63;
port[$3C9] := pal[j].g*intensity div 63;
port[$3C9] := pal[j].b*intensity div 63;
end;
end;
procedure set_to_color(r,g,b,h: integer);
var
j : integer;
begin
port[$3C8] := $00;
for j := 0 to 255 do begin
port[$3C9] := pal[j].r+(r-pal[j].r)*h div 63;
port[$3C9] := pal[j].g+(g-pal[j].g)*h div 63;
port[$3C9] := pal[j].b+(b-pal[j].b)*h div 63;
end;
end;
procedure fade_out(t : integer); {fades from pal to black}
begin
for j := 63 downto 0 do begin waitretrace; set_intensity(j); delay(t); end;
end;
procedure fade_in(t : integer); {fades from black to pal}
begin
for j := 0 to 63 do begin waitretrace; set_intensity(j); delay(t); end;
end;
procedure flash_in(r,b,g: byte;t : integer); {fades from pal to color}
begin
for j := 0 to 63 do begin waitretrace; set_to_color(r,b,g,j); delay(t); end;
end;
procedure flash_out(r,g,b: byte;t : integer); {fades from color to pal}
begin
for j := 63 downto 0 do begin waitretrace;set_to_color(r,g,b,j);delay(t);end;
end;
procedure drawmain;
begin
tc(8);
gotoxy(58,16);write(' Introduction ');
gotoxy(58,17);write(' Blade Info ');
gotoxy(58,18);write(' Articles ');
gotoxy(58,19);write(' Interviews ');
gotoxy(58,20);write(' Best ANSIs ');tb(0);
end;
procedure showmain (i: integer);
begin
tc (11);
if y=16 then begin gotoxy(58,y);write(' Introduction');end;
if y=17 then begin gotoxy(58,y);write(' Blade Info ');end;
if y=18 then begin gotoxy(58,y);write(' Articles ');end;
if y=19 then begin gotoxy(58,y);write(' Interviews ');end;
if y=20 then begin gotoxy(58,y);write(' Best ANSIs ');end;tb(0);
end;
procedure drawintro;
begin
tc(8);
gotoxy(58,16);write(' Introduction ');
gotoxy(58,17);write(' Coders Notes ');
gotoxy(58,18);write(' Contributors ');
gotoxy(58,19);write(' Contacting BTH ');
gotoxy(58,20);write(' ');tb(0);
end;
procedure showintro (i: integer);
begin
tc (11);
if y=16 then begin gotoxy(58,y);write(' Introduction');end;
if y=17 then begin gotoxy(58,y);write(' Coders Notes');end;
if y=18 then begin gotoxy(58,y);write(' Contributors');end;
if y=19 then begin gotoxy(58,y);write(' Contacting BTH');end;tb(0);
end;
procedure drawblade;
begin
tc(8);
gotoxy(58,16);write(' The Edge 12/95 ');
gotoxy(58,17);write(' Members ');
gotoxy(58,18);write(' Sites ');
gotoxy(58,19);write(' ');
gotoxy(58,20);write(' ');tb(0);
end;
procedure showblade (i: integer);
begin
tc (11);
if y=16 then begin gotoxy(58,y);write(' The Edge 12/95');end;
if y=17 then begin gotoxy(58,y);write(' Members');end;
if y=18 then begin gotoxy(58,y);write(' Sites');end;tb(0);
end;
procedure drawarticles;
begin
tc(8);
gotoxy(58,16);write(' ''The Scene'' ');
gotoxy(58,17);write(' Acid Pack ');
gotoxy(58,18);write(' Legend Pack ');
gotoxy(58,19);write(' ');
gotoxy(58,20);write(' ');tb(0);
end;
procedure showarticles (i: integer);
begin
tc (11);
if y=16 then begin gotoxy(58,y);write(' ''The Scene''');end;
if y=17 then begin gotoxy(58,y);write(' Acid Pack');end;
if y=18 then begin gotoxy(58,y);write(' Legend Pack');end;
if y=19 then begin gotoxy(58,y);write(' ');end;tb(0);
end;
procedure drawinterview;
begin
tc(8);
gotoxy(58,16);write(' kuma ');
gotoxy(58,17);write('subconsciousness');
gotoxy(58,18);write(' modeus khahn ');
gotoxy(58,19);write(' ');
gotoxy(58,20);write(' ');tb(0);
end;
procedure showinterview (i: integer);
begin
tc (11);
if y=16 then begin gotoxy(58,y);write(' kuma');end;
if y=17 then begin gotoxy(58,y);write('subconsciousness');end;
if y=18 then begin gotoxy(58,y);write(' modeus khahn');end;
if y=19 then begin gotoxy(58,y);write(' ');end;tb(0);
end;
procedure drawpics;
begin
tc (8);
gotoxy(58,16);write(' Number 1 ');
gotoxy(58,17);write(' Number 2 ');
gotoxy(58,18);write(' Number 3 ');
gotoxy(58,19);write('Reviewer''s Notes');
gotoxy(58,20);write(' ');tb(0);
end;
procedure showpics (I:integer);
begin
tc(11);
if y=16 then begin gotoxy(58,y);write(' Number 1 ');end;
if y=17 then begin gotoxy(58,y);write(' Number 2 ');end;
if y=18 then begin gotoxy(58,y);write(' Number 3 ');end;
if y=19 then begin gotoxy(58,y);write('Reviewer''s Notes');end;tb(0);
end;
Procedure ansiscroll;
begin
directvideo := false;
{$I-}
reset(ansi);
{$I+}
if ioresult <> 0 then
begin
writeln('BTH Data File : ANSI.DAT not found! ');
halt;
end;
Assign(output, '');Rewrite(output);clrscr;found:=false;
repeat
begin readln(ansi,ch);if ch=marker then found:=true;end;
until found;
repeat
begin
read(ansi,ch);write(output,ch);
end;
until ch=marker;
gotoxy(1,25);writeln(' Press any key to continue ...');
close(ansi);ch:=readkey;
sliderestorescreen(1,up);disposescreen(1);
end;
procedure sitescroll;
begin
y:=0;
repeat
move (@bbs^,memw[$b800:y*160],6720); {move-source,destination,size}
ch:=upcase(readkey);
if ch=#80 then begin
move(memw[$b800:160],memw[$b800:0],9440);
dec(y); {if press down then decrease Y}
end;
if ch=#72 then begin
if y>0 then move(memw[$b800:0],memw[$b800:160],9440);
if y>0 then inc(y); {if press up then increase Y}
end;
until ch=#27; {Until ESC is pressed}
sliderestorescreen(1,up);disposescreen(1);
end;
procedure edgescroll;
begin
y:=0;
repeat
move (@edge^,memw[$b800:y*160],16640); {move-source,destination,size}
ch:=upcase(readkey);
if ch=#80 then begin
move(memw[$b800:160],memw[$b800:0],9440);
dec(y); {if press down then decrease Y}
end;
if ch=#72 then begin
if y>0 then move(memw[$b800:0],memw[$b800:160],9440);
if y>0 then inc(y); {if press up then increase Y}
end;
until ch=#27; {Until ESC is pressed}
sliderestorescreen(1,up);disposescreen(1);
end;
procedure memberscroll;
begin
y:=0;
repeat
move (@mem^,memw[$b800:y*160],9600); {move-source,destination,size}
ch:=upcase(readkey);
if ch=#80 then begin
move(memw[$b800:160],memw[$b800:0],9440);
dec(y); {if press down then decrease Y}
end;
if ch=#72 then begin
if y>0 then move(memw[$b800:0],memw[$b800:160],9440);
if y>0 then inc(y); {if press up then increase Y}
end;
until ch=#27; {Until ESC is pressed}
sliderestorescreen(1,up);disposescreen(1);
end;
Procedure scroller;
procedure clear;
begin
for i:=1 to 500 do
ray[i]:=' ';
end;
procedure scroll;
begin
if q<1 then q:=1;
if limit>20 then
if q>limit then q:=limit;
x:=9;y:=6;tb(1);tc(15);
for i:=1 to 15 do
begin
gotoxy(x,y);write(' ');
gotoxy(x,y);writeln(ray[q]);y:=y+1;q:=q+1;
end;
tc(15);tb(7);gotoxy(65,23);write('[',q,'/',max,'] ');
tb(0);tc(15);tb(1);
percent:=100 * (q / max);
percent2:=percent/(100/7);
{* alright this is the messiest part of my code. all this does is
make a scroll bar on the side, its not very efficient, but it works
could've probably made some weird complicated loop, but chose instead to
go with the cut n' paste method heh. =) *}
if percent2 > 0 then begin if percent2 <2 then begin
tc(15);tb(1);gotoxy(77,10);write('▓');
gotoxy(77,11);tc(1);tb(7);write('▓');
gotoxy(77,12);tc(1);tb(7);write('▓');
gotoxy(77,13);tc(1);tb(7);write('▓');
gotoxy(77,14);tc(1);tb(7);write('▓');
gotoxy(77,15);tc(1);tb(7);write('▓');
gotoxy(77,16);tc(1);tb(7);write('▓');end;end;
if percent2 > 2 then begin if percent2 <3 then begin
tc(15);tb(1);gotoxy(77,11);write('▓');
gotoxy(77,10);tc(1);tb(7);write('▓');
gotoxy(77,12);tc(1);tb(7);write('▓');
gotoxy(77,13);tc(1);tb(7);write('▓');
gotoxy(77,14);tc(1);tb(7);write('▓');
gotoxy(77,15);tc(1);tb(7);write('▓');
gotoxy(77,16);tc(1);tb(7);write('▓');end;end;
if percent2 > 3 then begin if percent2 < 4 then begin
tc(15);tb(1);gotoxy(77,12);write('▓');
gotoxy(77,10);tc(1);tb(7);write('▓');
gotoxy(77,11);tc(1);tb(7);write('▓');
gotoxy(77,13);tc(1);tb(7);write('▓');
gotoxy(77,14);tc(1);tb(7);write('▓');
gotoxy(77,15);tc(1);tb(7);write('▓');
gotoxy(77,16);tc(1);tb(7);write('▓');end;end;
if percent2 > 4 then begin if percent2<5 then begin
tc(15);tb(1);gotoxy(77,13);write('▓');
gotoxy(77,10);tc(1);tb(7);write('▓');
gotoxy(77,11);tc(1);tb(7);write('▓');
gotoxy(77,12);tc(1);tb(7);write('▓');
gotoxy(77,14);tc(1);tb(7);write('▓');
gotoxy(77,15);tc(1);tb(7);write('▓');
gotoxy(77,16);tc(1);tb(7);write('▓');end;end;
if percent2 > 5 then begin if percent2<6 then begin
tc(15);tb(1);gotoxy(77,14);write('▓');
gotoxy(77,10);tc(1);tb(7);write('▓');
gotoxy(77,11);tc(1);tb(7);write('▓');
gotoxy(77,12);tc(1);tb(7);write('▓');
gotoxy(77,13);tc(1);tb(7);write('▓');
gotoxy(77,15);tc(1);tb(7);write('▓');
gotoxy(77,16);tc(1);tb(7);write('▓');end;end;
if percent2 > 6 then begin if percent2<7 then begin
tc(15);tb(1);gotoxy(77,15);write('▓');
gotoxy(77,10);tc(1);tb(7);write('▓');
gotoxy(77,11);tc(1);tb(7);write('▓');
gotoxy(77,12);tc(1);tb(7);write('▓');
gotoxy(77,13);tc(1);tb(7);write('▓');
gotoxy(77,14);tc(1);tb(7);write('▓');
gotoxy(77,16);tc(1);tb(7);write('▓');end;end;
if percent2 >= 7 then begin tc(15);tb(1);gotoxy(77,16);write('▓');
gotoxy(77,10);tc(1);tb(7);write('▓');
gotoxy(77,11);tc(1);tb(7);write('▓');
gotoxy(77,12);tc(1);tb(7);write('▓');
gotoxy(77,13);tc(1);tb(7);write('▓');
gotoxy(77,14);tc(1);tb(7);write('▓');
gotoxy(77,15);tc(1);tb(7);write('▓');end;
tb(0);
end;
begin
fade_out(20);readeransi;fade_in(1);Flash_Out(100,16,32,20);
tb(7);tc(0);gotoxy(12,2);write(title);gotoxy(12,3);write(author);tb(0);tc(15);
done:=false;
assign(tf,'bth2.dat');
{$I-}
reset(tf);
{$I+}
if ioresult <> 0 then
begin
writeln('BTH Data File : BTH2.DAT not found! ');
halt;
end;
repeat
readln(tf,s);
until s=fn;
readln(tf,max);limit:=max-13;
for i:=1 to max do readln(tf,ray[i]);
close(tf);max:=max+2;
q:=1;scroll;
repeat
ch:=upcase(readkey);
if max > 16 then begin
(* down scroll *)
if ch=#80 then
begin
q:=q-14;scroll;
end;
(* up scroll *)
if ch=#72 then
begin
q:=q-16;scroll;
end;
(* page down *)
if ch=#81 then
begin
scroll;
end;
(* page up *)
if ch=#73 then
begin
q:=q-30;scroll;
end;
(* home key *)
if ch=#71 then
begin
tc(1);tb(7);for n:=11 to 16 do begin
gotoxy(77,n);write('▓');end;
q:=1;scroll;
end;
(* end key *)
if ch=#79 then
begin
tc(1);tb(7);for n:=10 to 15 do begin
gotoxy(77,n);write('▓');end;
q:=max;scroll;
end;
end;
(* exit reader *)
if ch=#27 then done:=true;
until done;done:=false;clear;
sliderestorescreen(1,up);disposescreen(1);
end;
procedure introduction;
begin
drawintro;showintro (y);count:=1;
repeat
if keypressed=true then begin ch := upcase (readkey);
(*=- when the hit [esc] -=*)
if ch = #27 then done := true;
if ch = #0 then begin ch := readkey;
(*=- Up arror/cursor crap -=*)
if ch = #72 then begin if wherey <> 16 then begin
dec (y);drawintro;showintro (y);end;end;
(*=- Down arror/cursor crap -=*)
if ch = #80 then begin if wherey <> 19 then begin
inc(y);drawintro;showintro(y);end;end;end;
(*=- when they hit enter -=*)
if ch = #13 then begin
if y=16 then begin savescreen(1);fn:='intro.bth';title:='BTH Issue #2 Introduction';author:='Mindcrime';
scroller;y:=16;drawintro;showintro(y);continue;end;
if y=17 then begin savescreen(1);fn:='notes.bth';title:='Programmers Notes';author:='shivan bastard';
scroller;y:=17;drawintro;showintro(y);continue;end;
if y=18 then begin savescreen(1);fn:='credits.bth';title:='BTH Credits';author:='BTH Staff';
scroller;y:=18;drawintro;showintro(y);continue;end;
if y=19 then begin savescreen(1);fn:='contact.bth';title:='How to contribute';author:='BTH Staff';
scroller;y:=19;drawintro;showintro(y);continue;end;
end;
end;
until done;tb (0);done:=false;
end;
procedure blade;
begin
drawblade;showblade (y);count:=1;
repeat
if keypressed=true then begin ch := upcase (readkey);
(*=- when the hit [esc] -=*)
if ch = #27 then done := true;
if ch = #0 then begin ch := readkey;
(*=- Up arror/cursor crap -=*)
if ch = #72 then begin if wherey <> 16 then begin
dec (y);drawblade;showblade (y);end;end;
(*=- Down arror/cursor crap -=*)
if ch = #80 then begin if wherey <>18 then begin
inc(y);drawblade;showblade(y);end;end;end;
(*=- when they hit enter -=*)
if ch = #13 then begin
if y=16 then begin savescreen(1);
edgescroll;y:=16;drawblade;showblade(y);continue;end;
if y=17 then begin savescreen(1);
memberscroll;y:=17;drawblade;showblade(y);continue;end;
if y=18 then begin savescreen(1);
sitescroll;y:=18;drawblade;showblade(y);continue;end;
end;end;
until done;tb (0);done:=false;
end;
procedure articles;
begin
drawarticles;showarticles(y);count:=1;
repeat
if keypressed=true then begin ch := upcase (readkey);
(*=- when the hit [esc] -=*)
if ch = #27 then done := true;
if ch = #0 then begin ch := readkey;
(*=- Up arror/cursor crap -=*)
if ch = #72 then begin if wherey <> 16 then begin
dec (y);drawarticles;showarticles (y);end;end;
(*=- Down arror/cursor crap -=*)
if ch = #80 then begin if wherey <> 18 then begin
inc(y);drawarticles;showarticles(y);end;end;end;
(*=- when they hit enter -=*)
if ch = #13 then begin
if y=16 then begin savescreen(1);fn:='article.1';title:='''the scene''';author:='Belial';
scroller;y:=16;drawarticles;showarticles(y);continue;end;
if y=17 then begin savescreen(1);fn:='article.2';title:='The ACiD Pack';author:='Shivan Bastard and Pushead';
scroller;y:=17;drawarticles;showarticles(y);continue;end;
if y=18 then begin savescreen(1);fn:='article.3';title:='The Legend Pack';author:='Shivan Bastard and Pushead';
scroller;y:=18;drawarticles;showarticles(y);continue;end;
end;end;
until done;tb (0);done:=false;
end;
procedure interviews;
begin
drawinterview;showinterview(y);count:=1;
repeat
if keypressed=true then begin ch := upcase (readkey);
(*=- when the hit [esc] -=*)
if ch = #27 then done := true;
if ch = #0 then begin ch := readkey;
(*=- Up arror/cursor crap -=*)
if ch = #72 then begin if wherey <> 16 then begin
dec (y);drawinterview;showinterview(y);end;end;
(*=- Down arror/cursor crap -=*)
if ch = #80 then begin if wherey <> 18 then begin
inc(y);drawinterview;showinterview(y);end;end;end;
(*=- when they hit enter -=*)
if ch = #13 then begin
if y=16 then begin savescreen(1);fn:='iv.1';title:='Interview with Kuma';author:='Shivan Bastard';
scroller;y:=16;drawinterview;showinterview(y);continue;end;
if y=17 then begin savescreen(1);fn:='iv.2';title:='Interview with Subconsciousness';author:='Shivan Bastard';
scroller;y:=17;drawinterview;showinterview(y);continue;end;
if y=18 then begin savescreen(1);fn:='iv.3';title:='Interview with Modeus Khahn';author:='Shivan Bastard';
scroller;y:=18;drawinterview;showinterview(y);continue;end;
end;end;
until done;tb (0);done:=false;
end;
procedure pics;
begin
drawpics;showpics(y);count:=1;
repeat
if keypressed=true then begin ch := upcase (readkey);
(*=- when the hit [esc] -=*)
if ch = #27 then done := true;
if ch = #0 then begin ch := readkey;
(*=- Up arror/cursor crap -=*)
if ch = #72 then begin if wherey <> 16 then begin
dec (y);drawpics;showpics(y);end;end;
(*=- Down arror/cursor crap -=*)
if ch = #80 then begin if wherey <>19 then begin
inc(y);drawpics;showpics(y);end;end;end;
(*=- when they hit enter -=*)
if ch = #13 then begin
if y=16 then begin savescreen(1);marker:=#1;
ansiscroll;y:=16;drawpics;showpics(y);continue;end;
if y=17 then begin savescreen(1);marker:=#2;
ansiscroll;y:=17;drawpics;showpics(y);continue;end;
if y=18 then begin savescreen(1);marker:=#3;
ansiscroll;y:=18;drawpics;showpics(y);continue;end;
if y=19 then begin savescreen(1);fn:='notes.rev';
title:='Reviewer''s Notes';Author:='Pushead + Shivan Bastard';
scroller;y:=19;drawpics;showpics(y);continue;end;
end;end;
until done;tb (0);done:=false;
end;
procedure mainmenu;
begin
memw[$0000:$041a]:=memw[$0000:$041c];
drawmain;showmain (y);count:=1;
repeat
if keypressed=true then begin ch := upcase (readkey);
(*=- when the hit [esc] -=*)
if ch = #27 then done := true;
if ch = #0 then begin ch := readkey;
(*=- Up arror/cursor crap -=*)
if ch = #72 then begin if wherey <> 16 then begin
dec (y);drawmain;showmain (y);end;end;
(*=- Down arror/cursor crap -=*)
if ch = #80 then begin if wherey <> 20 then begin
inc(y);drawmain;showmain(y);end;end;end;
(*=- when they hit enter -=*)
if ch = #13 then begin
if y=16 then begin y:=16;introduction;y:=16;drawmain;showmain(y);continue;end;
if y=17 then begin y:=16;blade;y:=17;drawmain;showmain(y);continue;end;
if y=18 then begin y:=16;articles;y:=18;drawmain;showmain(y);continue;end;
if y=19 then begin y:=16;interviews;y:=19;drawmain;showmain(y);continue;end;
if y=20 then begin y:=16;pics;y:=20;drawmain;showmain(y);continue;end;
end;
end;
until done;tb(0);
end;
begin
tc(15);tb(0);assign(ansi,'ansi.dat');
{$I-}
reset(ansi);
{$I+}
if ioresult <> 0 then
begin
writeln('BTH Data file : ANSI.DAT not found! ');
halt;
end;
fn:='bth2.dat';get_color(pal);offcursor;
fade_out(30);clrscr;introansi;fade_in(30);ch:=readkey;fade_out(30);offcursor;fade_out(1);
clrscr;y:=16;mainansi;fade_in(20);mainmenu;
fade_out(20);clrscr;endansi;fade_in(30);gotoxy(1,24);oncursor;
end.